Style Object Properties
The interface to style objects is entirely procedural. You manipulate the information in a style object by modifying its properties using QuickDraw GX functions.Style objects have 22 accessible properties, as shown in Figure 3-1. The properties are grouped into columns that reflect the category of shape that uses them. Note that, because a style is an object and not a data structure, the order of the properties as shown in Figure 3-1 is completely arbitrary. Properties in italics are references to other objects.
Figure 3-1 The style object and its properties
Seven properties pertain mostly to style objects associated with graphic shapes:
Thirteen of the style object's properties pertain only to styles associated with typographic shapes. The portion of a typographic shape to which a style object applies is called a style run. The first seven typographic style properties apply, for the most part, to all typographic shapes:
- Pen width. The width of the pen used to draw the shape.
- Cap. The shape (such as an arrowhead, or any other geometric shape) to draw at the start and end of each contour in the shape.
- Join. The appearance (such as rounded or sharp, or any other geometric shape) of corners where a shape's lines or contours meet.
- Dash. The appearance of dashed lines or contours in a shape. The dashing capability is very general in QuickDraw GX; you can specify any geometric shape, or even a sequence of glyphs, for a dash.
- Pattern. The pattern (actually, any geometric shape, glyph shape, or bitmap shape) to use in filling the geometry of the shape.
- Curve error. The allowable error for operations such as converting a path shape to a polygon shape.
- Attributes. A set of flags that allow you to specify how QuickDraw GX places the pen and whether the shape is constrained to a grid when drawn. (The grid-constraining attributes can apply to typographic shapes also.)
The remaining six of the thirteen typographic style properties apply to layout shapes only:
- Font. The reference to the font to use in drawing the text of this style run. (In QuickDraw GX, a font is an object.)
- Text face. The text face--the constructed stylistic variation from plain text--to apply when drawing the text of this style run.
- Text size. The size, in typographic points (72 per inch), to draw the text of this style run.
- Alignment. The alignment value to use when drawing the text of this style run. Text may be left-aligned, right-aligned, anywhere between the two alignments (such as centered), or fully justified. (This property is not used by layout shapes).
- Font variations. The list of font variations--stylistic variations built into the font--specified for drawing the text of this style run.
- Encoding. The type of character encoding used to represent the text of this style run, as well as its script and language.
- Text attributes. A set of flags that allow you to specify how QuickDraw GX alters glyph outlines or chooses the proper metrics for horizontal or vertical text.
The two remaining style object properties pertain to all styles, for all shapes:
- Run controls. A set of values and flags that control various aspects of how the text in this style run is displayed.
- Kerning adjustments array. An array specifying changes to the font-specified kerning (positional adjustment) for pairs of glyphs in this style run.
- Glyph substitutions array. An array specifying substitute glyphs for those that would normally be displayed in this style run.
- Run features array. An array specifying the set of font features--typographic capabilities as defined by the font--to apply to the text of this style run.
- Priority justification override. A structure that redefines the justification priorities and behaviors for whole classes of glyphs.
- Glyph justification overrides array. An array that redefines the justification priorities and behaviors for individual glyphs.
QuickDraw GX provides functions to manipulate each of these style object properties. Table 3-1 shows where to go for that information, depending on the type of shape object that uses the style.
- Owner count. The number of existing references to this style object.
- Tag list. A list of references to custom information about this style object, stored in private data structures called tag objects. The chapter "Tag Objects" in this book describes tag objects in general and how you can use them to add custom information to objects.
As Table 3-1 shows, most style-object properties and functions are described elsewhere. Only those properties that pertain to all shapes--the owner count and tag list, and the functions that manipulate them--are described in this chapter.